package PenTest.huawei;

import java.util.Scanner;

public class Main {

    private static int res=0;

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split(" ");
        int N = Integer.parseInt(s[0]);
        int S = Integer.parseInt(s[1]);
        //递归
        //所有题目答完如果恰好为S分，则结果数+1
        Main m = new Main();
        m.answer(10,S,1);
        System.out.printf(String.valueOf(res));
    }


    public void answer(int score,int targetScore,int currentQuestion) {
        if(score==targetScore&&currentQuestion==11) {
            res++;
            return;
        }
        if(currentQuestion>10) {
            return;
        }
        answer(score*2,targetScore,currentQuestion+1);
        answer(score-currentQuestion,targetScore,currentQuestion+1);
    }
}
